{extend name="common/common" /}
{block name="main"}
<div id="page-wrapper" class="gray-bg dashbard-1">
    {include file="common/nav-header"/} <!--顶部-->
    <div class="col-lg-12">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>幻灯片管理</h5>
            </div>
            <div class="ibox-content">
                <form id="form" class="form-horizontal m-t " method="post" enctype="multipart/form-data" action="{:url('add')}">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">校名：</label>
                        <div class="col-sm-3">
                            <input  type="text" id="college_name" class="form-control" name="college_name"  >
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">校英文名：</label>
                        <div class="col-sm-3">
                            <input  type="text" id="college_e_name" class="form-control" name="college_e_name">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">QS排名：</label>
                        <div class="col-sm-3">
                            <input  type="text" id="qs" class="form-control" name="qs">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">学校简介：</label>
                        <div class="col-sm-3">
                            <textarea name="introduce" id="introduce" class="form-control" rows="7"></textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">链接：</label>
                        <div class="col-sm-3">
                            <input  type="text" id="href" class="form-control" name="href"  value="www.bugangel.cn" >
                        </div>
                    </div>
                    <div class="form-group" id="picture">
                        <label class="col-sm-3 control-label">图片：</label>
                        <div class="col-sm-9">
                            <input type="file" class="file" name="picture"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-4 col-sm-offset-3">
                            <button class="btn btn-primary" type="submit">提交</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <!--尾部-->
    {include file="common/footer"/}
</div>

<script>
    $('form').submit(function(){
        var college_name = $('#college_name').val();
        var college_e_name = $('#college_e_name').val();
        var title = $('#title').val();
        var introduce = $('#introduce').val();
        var href = $('#href').val();
        var file = $('#file').val();
        if(college_name === ''){
            layer.msg('请填写校名',{time:1000});
            return false;
        }
        if(college_e_name === ''){
            layer.msg('请填写校英文名',{time:1000});
            return false;
        }
        if(title === ''){
            layer.msg('请填写图片名称',{time:1000});
            return false;
        }
        if(introduce === ''){
            layer.msg('请填写学校简介',{time:1000});
            return false;
        }
        if(href === ''){
            layer.msg('请填写链接',{time:1000});
            return false;
        }
        if(file === ''){
            layer.msg('请上传图片文件',{time:1000});
            return false;
        }
    });
</script>
{/block}